package com.woniu.sharepark.leasesystem.tenant.service.impl;

import com.woniu.sharepark.leasesystem.tenant.dao.CarDAO;
import com.woniu.sharepark.leasesystem.tenant.pojo.Car;
import com.woniu.sharepark.leasesystem.tenant.service.CarService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 汽车逻辑实现类
 * @author xin
 * @date 2019/6/4 16:41
 * version v1.0
 */
@Service
public class CarServiceImpl implements CarService {

    @Resource
    private CarDAO carDAO;

    @Override
    public List<Car> findAllCarPage(Integer currentPage, Integer pageSize, Car car) {
        return carDAO.selectAllCarPage(currentPage,pageSize,car);
    }

    @Override
    public List<Car> findByCarIds(Integer currentPage,Integer pageSize,String carIds) {
        return carDAO.selectByCarIds(currentPage,pageSize,carIds);
    }

    @Override
    @Cacheable(value = "carCount")
    public int findAllCount() {
        return carDAO.selectAllCount();
    }
}
